﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SMS.Remote;
using SMS.Core;
using SMS.Contract;
using System.Threading;
using SMS.Core.Classes;
using System.Globalization;
using System.Data.SqlClient;

namespace SMS.Console
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();

            //ClientContactor.Initialize();
            //ClientRemote.OnReceive += new MessageEventHandler(ClientRemote_OnReceive);
        }

        /// <summary>
        /// 在文本显示信息。
        /// </summary>
        private void SetText(TextBox textBox, string message)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new SetTextCallBack(SetText), new object[]{textBox, message});
            }
            else
            {
                textBox.AppendText(string.Format("{0}{1}", message, Environment.NewLine));
            }
        }

        private ISMSService m_SMSService;
        private ISMSService SMSService
        {
            get
            {
                if (m_SMSService == null) m_SMSService = new SMSClient();
                return m_SMSService;
            }
        }
    }
}
